# Maintainer: David Sugar <tychosoft@gmail.com>
# Contributor: David Sugar <tychosoft@gmail.com>
pkgname=apollo
pkgver=0.2.3
pkgrel=0
pkgdesc="Web management and api services for Coventry"
url="https://gitlab.com/tychosoft/apollo"
arch="all"
license="GPL-3.0-or-later"
makedepends="make musl-dev go"
subpackages="$pkgname-doc $pkgname-openrc"
source="https://gitlab.com/tychosoft/apollo/-/archive/v$pkgver/apollo-v$pkgver.tar.gz apollo.initd"
builddir="$srcdir"/$pkgname-v$pkgver
options="!check net"

build() {
	make PREFIX=/usr SYSCONFDIR=/etc LOCALSTATEDIR=/var release
}

check() {
	make test
}

package() {
	make DESTDIR="$pkgdir" PREFIX=/usr SYSCONFDIR=/etc LOCALSTATEDIR=/var install
	install -D -m 755 "$srcdir"/$pkgname.initd "$pkgdir"/etc/init.d/$pkgname
	install -Dm644 LICENSE.md "$pkgdir"/usr/share/licenses/$pkgname/LICENSE.md
	install -Dm644 README.md "$pkgdir"/usr/share/doc/$pkgname/README.md
	install -Dm644 FEATURES.md "$pkgdir"/usr/share/doc/$pkgname/FEATURES.md
}

sha512sums="
8ed51fd1a74fbc4e94a4810216a7541c264a4993ea5f4a783f3dc5c01e19a91a355bea560fc94d8c14d2ae3a4554fa8b5c2cb871e57a0cae204572db792d6f1c  apollo-v0.2.3.tar.gz
792c1e827a3a19cfae1d79c589cd6c93a786fa4affa572d153bd179fcf3d8b00866003043177d04b921c7d07a475c21ecee89618d99e8c4cf078be8a5b950bbc  apollo.initd
"
